var expiredTime = $("#expiredTime"),
    availableTime = $("#availableTime"),
    couponForm = $("#couponForm"),
    save_coupon = $("#save_coupon"),
    duration = $("#duration");

var id = $("input[name=id]").val();

// 保存拍卖活动
save_coupon.on("click", function () {
    var data = couponForm.formToJson();
    $.post("pointsystem/savelotgroup", data, function (res) {
        alert(res.message);
        if (res.success) {
            location.href = "pointsystem/lotterylist";
        }
    }).fail(function () {
        alert("服务器错误");
    });
});

function initDatePicker(data) {
    availableTime.datetimepicker({
        prevText: '<i class="fa fa-chevron-left"></i>',
        nextText: '<i class="fa fa-chevron-right"></i>',
        showButtonPanel: false
    });
    availableTime.datetimepicker('setDate',new Date());
}

$(function(){
    initDatePicker();
});
